﻿package mortal.game.net.command
{
    import Framework.MQ.*;
    import Message.Public.*;
    import com.gengine.debug.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.mvc.core.*;

    public class PositionUpdateCommand extends BroadCastCall
    {
        private var _passTo:SPassTo;

        public function PositionUpdateCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_3:SAttributeUpdate = null;
            var _loc_2:* = param1.messageBase as SSeqAttributeUpdate;
            var _loc_4:* = new SPassTo();
            _loc_4.toPoint = new SPoint();
            _loc_4.passToId = _loc_2.code;
            for each (_loc_3 in _loc_2.updates)
            {
                
                switch(_loc_3.attribute.__value)
                {
                    case EEntityAttribute._EAttributeSpaceId:
                    {
                        _loc_4.mapId = _loc_3.value;
                        break;
                    }
                    case EEntityAttribute._EAttributePointX:
                    {
                        _loc_4.toPoint.x = _loc_3.value;
                        break;
                    }
                    case EEntityAttribute._EAttributePointY:
                    {
                        _loc_4.toPoint.y = _loc_3.value;
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }
            Log.printMsg(LogType.other, "mapPassTo: ", _loc_4.passToId, _loc_4.mapId, _loc_4.toPoint.x, _loc_4.toPoint.y, new Date().toString());
            NetDispatcher.dispatchCmd(ServerCommand.MapPointUpdate, _loc_4);
            return;
        }// end function

    }
}
